﻿<s:SurfaceWindow x:Class="MediaSurfaceV2.SurfaceWindow1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="http://schemas.microsoft.com/surface/2008"
    Title="MediaSurfaceV2"
    >
  <s:SurfaceWindow.Resources>

        <ImageBrush x:Key="WindowBackground" Stretch="None" Opacity="0.6" ImageSource="pack://application:,,,/Resources/WindowBackground.jpg"/>

        <Style x:Key="LibraryControlInScatterViewItemContentStyle" TargetType="{x:Type s:ScatterViewItem}">
            <Setter Property="MinWidth" Value="{Binding Path=Content.MinWidth, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="MinHeight" Value="{Binding Path=Content.MinHeight, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="MaxWidth" Value="{Binding Path=Content.MaxWidth, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="MaxHeight" Value="{Binding Path=Content.MaxHeight, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="IsActive" Value="{Binding Path=Content.IsActive,RelativeSource={RelativeSource Self}, Mode=OneWayToSource}"/>
            <Setter Property="Width" Value="{Binding Path=Content.Width, RelativeSource={RelativeSource Self}, Mode=TwoWay}"/>
            <Setter Property="Height" Value="{Binding Path=Content.Height, RelativeSource={RelativeSource Self}, Mode=TwoWay}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type s:ScatterViewItem}">
                        <ContentPresenter />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        
        <Style x:Key="ControlInScatterViewItemContentStyle" TargetType="{x:Type s:ScatterViewItem}">
            <Setter Property="MinWidth" Value="{Binding Path=Content.MinWidth, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="MinHeight" Value="{Binding Path=Content.MinHeight, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="MaxWidth" Value="{Binding Path=Content.MaxWidth, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="MaxHeight" Value="{Binding Path=Content.MaxHeight, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="IsActive" Value="{Binding Path=Content.IsActive,RelativeSource={RelativeSource Self}, Mode=OneWayToSource}"/>
            <Setter Property="Width" Value="{Binding Path=Content.Width, RelativeSource={RelativeSource Self}, Mode=TwoWay}"/>
            <Setter Property="Height" Value="{Binding Path=Content.Height, RelativeSource={RelativeSource Self}, Mode=TwoWay}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type s:ScatterViewItem}">
                        <ContentPresenter />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


        <Style x:Key="BarItemStyle" TargetType="{x:Type s:LibraryBarItem}">
            <Style.Triggers>
                <Trigger Property="s:LibraryBarItem.IsItemDataEnabled" Value="False">
                    <Setter Property="s:LibraryBarItem.Padding" Value="5"/>
                    <Setter Property="s:LibraryBarItem.Background" Value="Blue"/>
                </Trigger>
            </Style.Triggers>
        </Style>

    </s:SurfaceWindow.Resources>

    <Grid Name ="Layout" Background="Transparent">
        <s:TagVisualizer VisualizationAdded="TagVisualizer_VisualizationAdded" Background="Transparent"  Grid.ZIndex ="98">
            <s:TagVisualizer.Definitions>
                <s:IdentityTagVisualizationDefinition Series="#09E2B797D2830789" Value="1"
                                                      Source="iPhoneVisualization.xaml" PhysicalCenterOffsetFromTag="1.75, 0.5"/>
            </s:TagVisualizer.Definitions>
            

            <s:ScatterView Name="scatterView1"  Background="Transparent" AllowDrop="True" s:SurfaceDragDrop.Drop="scatterView1_Drop">

                <s:ScatterViewItem Background="Transparent" Name="libraryBarSuper" Style="{StaticResource LibraryControlInScatterViewItemContentStyle}" 
                                     Orientation="0.0" Center="200,200"  AllowDrop="False" DecelerationRate="4500" AngularDecelerationRate="1200">
                </s:ScatterViewItem>
            </s:ScatterView>
        </s:TagVisualizer>
        <MediaElement Name="mediaElem" Grid.ZIndex ="97" Height="768" Width="1024" Stretch="Fill"/>
    </Grid>
</s:SurfaceWindow>
